#include<iostream>
using namespace std;
int main() {
	int s, b, c, d, e;
	int a[4] = { 0 };
	cin >> s;
	for (int i = 0; i < 4; i++) {
		a[i] = s % 10;
		s = s / 10;
	}
	b = (a[0] + 9) % 10;
	c = (a[1] + 9) % 10;
	d = (a[2] + 9) % 10;
	e = (a[3] + 9) % 10;
	s = c * 1000 + b * 100 + e * 10 + d;
	cout << "The encrypted number is " << s;
	return 0;
}
